import axios from '@/request/request'
//统一管理api :一旦接口地址发生改变,所有调用了接口的组件都需要修改,
import qs from 'qs'

//精品推荐
export const JingpinAPI=()=>axios.get("/products/recommend");
//热门兑换
export const RemenAPI=()=>axios.get("/products/hot");
//发送短信验证码    params = {}
export const SendSMSAPI = (params) => axios.post("/sendSMS", qs.stringify(params));
//登录请求
export const PhoneReginAPI = (params) => axios.post("/phoneRegin", qs.stringify(params));
//微信扫码登录
export const WeiXinLoginAPI = (params) => axios.post("/wechatUsers/PCLogin", qs.stringify(params));
//手机号关联微信登录
export const BinddingAPI = (params) => axios.post("/wechatUsers/binding", qs.stringify(params));
//获取用户信息
export const UserProfilesAPI=()=>axios.get("/shop/userProfiles")
//请求详情页的数据[地址参数]
export const GoodDetailsAPI=(params)=>axios.get(`/products/${params}`)
//加入购物车
export const AddToCartAPIAPI = (params) => axios.post("/shop/carts/add", qs.stringify(params));
//获取所有产品[请求体] axios.get(url,{params:''})
//params = {did:1,type:xx,min:0...}
export const GoodsSearchAPI=(params)=>axios.get("/products",{params})